<?php

class D_Plugin_Main extends Zend_Controller_Plugin_Abstract {
	
	
	public function __construct()
    {
       
    }

    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
    	
//         //save url every resquest
//         $action_dismiss = array('reissuepwd','login','logout','register','reissuepwdfinish','');
//         $controller_dismiss = array('account');
//         $session = new Zend_Session_Namespace("global");
        
//         $module = D_Utils::moduleName()=='default'? true:false;
//         $controller = in_array(D_Utils::controllerName(), $controller_dismiss);
//         $action = in_array(D_Utils::actionName(), $action_dismiss);
        
//         if($module):
// 	        if($controller || $action){
// 	        	//echo 'not save';
// 	        }else{
// 	        	$url = "";
// 	        	$url= str_replace(ROOT_URL, "", $_SERVER["REQUEST_URI"]);
// 	        	$session->storeUrl = $url;
// 	        	//echo $url;
// 	        }
// 	     endif;   
      	//$sysControl = new Zend_Session_Namespace( 'sys_control' );
       // echo $sysControl->db_timeout;
	 //  $this->checkTmpPassword($request);
    }
    
    
   
    function dispatchLoopShutdown(){
    	
        if(D_Auth::haslogin()){
	    		$objSessionNamespace = new Zend_Session_Namespace( 'userco' );
	  			$objSessionNamespace->setExpirationSeconds(3600);
    	}
    		
   		 if(D_Auth::hasAskulLogin()){
	    		$objSessionNamespace = new Zend_Session_Namespace( 'askul_admin' );
	  			$objSessionNamespace->setExpirationSeconds(3600);
    	 }
    	 
   		 if(D_Auth::hasSpLogin()){
	    		$objSessionNamespace = new Zend_Session_Namespace( 'servicer' );
	  			$objSessionNamespace->setExpirationSeconds(3600);
    	 }
    	
    	
    }
    
}

?>